class Solution:
    def largestOddNumber(self, num: str) -> str:
        size = len(num)
        for i in range(size - 1, -1, -1):
            if num[i] in ["1", "3", "5", "7", "9"]:
                return num[:i + 1]
        return ""


if __name__ == "__main__":
    print(Solution().largestOddNumber("52"))  # 5
    print(Solution().largestOddNumber("4206"))  #
    print(Solution().largestOddNumber("35427"))  # 35427
